import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class SingleThreadExecutor {
public static void main(String[] args) {
	ExecutorService executorService = Executors.newSingleThreadExecutor();
	
	
	Future<Void> submit = executorService.submit(new Callable<Void>() {

		@Override
		public Void call() throws Exception {
			
			Thread.sleep(5000);
			System.out.println("........1");
			return null;
		}
 
	});
	 
	System.out.println("===========");
	Future<Void> submit2 = executorService.submit(new Callable<Void>() {

		@Override
		public Void call() throws Exception {
			System.out.println("........2");
			Thread.sleep(1);
			return null;
		}
 
	}); 
	System.out.println("=========");
}
}
